package com.teatrace.model;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="t_product")
public class Product implements Serializable {

	private static final long serialVersionUID = -3350475692653862157L;
	
	@Id
	@GeneratedValue
	private Integer id;
	private String name;
	private String productNum;
	private Date produceTime;
	private Integer monthOfGuaranteePeriod;
	
	@OneToMany(fetch=FetchType.EAGER)
	@JoinColumn(name = "productId") 
	private Set<TraceInfo> traceInfoSet;
	
	public Set<TraceInfo> getTraceInfoSet() {
		return traceInfoSet;
	}
	public void setTraceInfoSet(Set<TraceInfo> traceInfoSet) {
		this.traceInfoSet = traceInfoSet;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getProductNum() {
		return productNum;
	}
	public void setProductNum(String productNum) {
		this.productNum = productNum;
	}
	public Date getProduceTime() {
		return produceTime;
	}
	public void setProduceTime(Date produceTime) {
		this.produceTime = produceTime;
	}
	public Integer getMonthOfGuaranteePeriod() {
		return monthOfGuaranteePeriod;
	}
	public void setMonthOfGuaranteePeriod(Integer monthOfGuaranteePeriod) {
		this.monthOfGuaranteePeriod = monthOfGuaranteePeriod;
	}
	
	
}
